<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\validate;

use think\Validate;

class TalkValidate extends Validate
{
    protected $rule = [
        'id'            => 'require|number',
        'title'         => 'require',
        'type1'         => 'require|number',
        'type'          => 'require|number',
        'bat_ids'       => 'require',
        'content'       => 'require',
        'talk_coin'     => 'require|number',
    ];
    protected $message = [
        'id.require'            => 'id不能为空',
        'id.number'             => 'id必须为数字',
        'type1.require'         => '请选择聊吧类型',
        'type1.number'          => '聊吧类型必须为数字',
        'type.require'          => '请选择类型',
        'type.number'           => '类型id必须为数字',
        'bat_ids.require'       => '请选择球队对战',
        'content.require'       => '内容不能为空',
        'talk_coin.require'     => '所需球币不能为空',
        'talk_coin.number'      => '所需球币必须为数字',
    ];

    protected $scene = [
        'add'  => ['title','type1','type','bat_ids','content','talk_coin'],
        'edit' => ['id','title','type1','type','bat_ids','content','talk_coin'],
    ];
}